/**
 * @description 获取当前页url
 */
export const getCurrentPageUrl = () => {
  let pages = getCurrentPages();
  let currentPage = pages[pages.length - 1];
  let url = currentPage.route;
  return url;
};

export const pageToLogin = () => {
  let path = getCurrentPageUrl();
  if (path && !path.includes("login")) {
    uni.navigateTo({
      url: "/pages/login/index",
    });
  }
};
